#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mcp_decode.h"
#include "mcp_logger.h"
#include "mcp_service.h"
#include <time.h>
#define SERVER_IP "192.168.0.129"
#define SERVER_PORT 18362
#define BUFFER_SIZE 2048

/**
 * 延时
 * @param sec 秒
 */
void sleep(unsigned long sec) {
    struct timespec req = {
        .tv_sec = sec,
        .tv_nsec = 0
    };
    nanosleep(&req, NULL);  // 睡眠 2 秒
}

// 连接状态回调
void connection_status_handler(bool connected, const char* reason) {
    if (connected) {
        LOG_INFO("Connection established: %s", reason);
    } else {
        LOG_WARN("Connection lost: %s", reason);
    }
}

/**
 * 接收到数据的回调处理函数
 * @param data
 * @param length
 */
int main(int argc, char* argv[]) {
    // mcp_init(SERVER_IP,SERVER_PORT);
}